package com.allwees.bs.core.modelbase.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.allwees.core.wf.WorkflowModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.ArrayUtils;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * Work flow Entity基类
 *
 * @author yangylsky
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@MappedSuperclass
public abstract class WfBaseEntity extends BaseEntity implements WorkflowModel {

    private static final long serialVersionUID = -1010197735693183734L;

    public static final String[] fields = ArrayUtils.addAll(BaseEntity.fields, "wfName", "wfUuid", "wfState");

    @JsonIgnore
    @JSONField(serialize = false)
    protected String wfName;

    @Column(length = 48)
    @JsonIgnore
    @JSONField(serialize = false)
    protected String wfUuid;

    @Column(length = 48)
    @JsonIgnore
    @JSONField(serialize = false)
    protected String wfState;

    @Override
    @JsonIgnore
    @JSONField(serialize = false)
    public String getBsKey() {
        return uuid;
    }
}
